﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using V8.Net;

namespace DreamSpace.Net.Extensions
{
    public abstract class DSSExtension : IDSSExtension
    {
        public abstract string TypeNameSpace { get; }
        public abstract string TypeName { get; }
    }

    public enum ExtensionMemberAccess { None, ReadOnly, FullAccess };

    public class ExtensionMember : Attribute
    {
        public string ScriptName { get { return _ScriptName; } }
        string _ScriptName;

        public ExtensionMemberAccess AccessType { get { return _AccessType; } }
        ExtensionMemberAccess _AccessType;

        public ExtensionMember(string scriptName, ExtensionMemberAccess accessType = ExtensionMemberAccess.FullAccess)
        {
            if (scriptName.IsNullOrWhiteSpace())
                throw new ArgumentNullException("scriptName");
            _ScriptName = scriptName;
            _AccessType = accessType;
        }
        public ExtensionMember(ExtensionMemberAccess accessType)
        {
            _AccessType = accessType;
        }
    }
}
